import { connect } from 'react-redux'
import MenuExample from '../../src/components/view/songList/list'
import { getSongList } from '../../src/api'
import {ListAction} from '../../src/actions/listAction'
//1.映射组件
const mapStateToProps = (state) => {
    return {
        data: state.getList.data
    }
}
//2.映射dispatch
const mapDispatchToProps = (dispatch) => {
    return {
        //定义一个方法 此方法会垂直映射到product的ui组件上      
        list() {
            dispatch(ListAction())
        },
        getList(){
         return  getSongList()
        }
    }
}
//通过connect将state和dispatch通过props属性垂直映射到ul组件
let ListContainer = connect(mapStateToProps, mapDispatchToProps)(MenuExample)
export default ListContainer